function getNowFormatDate(date) {
    var seperator1 = "-";
    var seperator2 = ":";
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = year + seperator1 + month + seperator1 + strDate;
    return currentdate;
}

function handleTime(value){
	var startTime=new Date();
	var endTime=new Date();
	if(value!="custom"){
		if(value=="today"){
			
		}else if(value=="yestoday"){
			startTime.setDate(startTime.getDate() - 1);
		}else if(value=="seven"){
	   		startTime.setDate(startTime.getDate() - 6);
	   	}else if(value=="thirty"){
	   		startTime.setDate(startTime.getDate() - 30);
	   	}
		$("#startTime").val(getNowFormatDate(startTime));
		$("#endTime").val(getNowFormatDate(endTime));
	}else{
   		if($("#startTime").val()==null || $("#startTime").val()=="" || $("#endTime").val()==null || $("#endTime").val()==""){
   			Showbo.Msg.alert('请输入开始时间和结束时间');
   			return;
   		}
   	}
	
}